// 读取score.txt文件并进行处理格式写入到score-ok.txt中
const fs = require("fs");

fs.readFile("./score.txt", "utf-8", (err, data) => {
  if (err) {
    return console.log(err.message);
  }
  const arrOld = data.split(" ");
  const arrNew = [];
  arrOld.forEach((item) => {
    arrNew.push(item.replace("=", ":"));
  });
  const strNew = arrNew.join("\r\n");
  fs.writeFile("./score-ok.txt", strNew, (err) => {
    if (err) {
      return console.log("write fail" + err.message);
    }
    console.log("write is success");
  });
  console.log(strNew);
});
